<cpanel include="../../config.php">

<?

/***************************************************************************
 *                                 phpmychat.php
 *                            -------------------
 *   Begin                : Thursday, April 16, 2005
 *   Copyright            : (C) 2005 Point and Code
 *   Domain               : http://www.pointandcode.com/
 *   Email                : support@pointandcode.com
 *   Version              : 1.0.0
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

$html_root_path = '../../';
$page_title = "PHPMyChat";
include $root_path.'common.php';
include $root_path.'page_header.php';

$big_wadge_of_stuff = <<<EOFpacman
<cpanel Cgi="listphpchats()">
EOFpacman;

$array_of_chatrooms_with_junk = explode('<br>', $big_wadge_of_stuff);

$array_of_chatrooms = array();
$i=0;

foreach($array_of_chatrooms_with_junk as $row) {
	// Get the URL of the cart manager...
	$temp = explode('<a href="', $row);
	$temp2 = explode('"', $temp[1]);
	$array_of_chatrooms[$i]['url'] = $temp2[0];

	// Get the path
	$temp2 = explode('">', $temp[1]);
	$temp3 = explode('</a>', $temp2[1]);
	$array_of_chatrooms[$i]['path'] = $temp3[0];

	$i++;
};

$template->set_filenames(array(
	'body' => $root_path.$template_path.'scripts/phpmychat.tpl')
);

foreach ($array_of_chatrooms as $row) {

	if (!empty($row['url'])) {
		$template->assign_block_vars('current_chatroom_row', array(
			'MANAGE_URL' => $row['url'],
			'NAME' => $row['path'],
		));
	};
};

//
// Add shopping cart stuff
//
$template->assign_vars(array(

	'S_ADD_ACTION' => "phpmychat_done.php",
	)
);





//
// Woohoo! All done!
//
$template->pparse('body');




include $root_path.'page_tail.php';




?>